package c.e.a.b.f.b;

import b.i.b.f;
import java.net.URL;
import java.util.Map;

/* compiled from: com.google.android.gms:play-services-measurement@@18.0.0 */
public final class c4 implements Runnable {
    public final URL a;
    public final byte[] b;
    public final z3 c;
    public final String d;
    public final Map<String, String> e;
    public final /* synthetic */ x3 f;

    public c4(x3 x3Var, String str, URL url, byte[] bArr, Map<String, String> map, z3 z3Var) {
        this.f = x3Var;
        f.N(str);
        this.a = url;
        this.b = bArr;
        this.c = z3Var;
        this.d = str;
        this.e = map;
    }

    /* JADX WARNING: Removed duplicated region for block: B:45:0x00c9 A:{SYNTHETIC, Splitter:B:45:0x00c9} */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x00e1  */
    /* JADX WARNING: Removed duplicated region for block: B:58:0x0102 A:{SYNTHETIC, Splitter:B:58:0x0102} */
    /* JADX WARNING: Removed duplicated region for block: B:63:0x011a  */
    /* JADX WARNING: Removed duplicated region for block: B:45:0x00c9 A:{SYNTHETIC, Splitter:B:45:0x00c9} */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x00e1  */
    /* JADX WARNING: Removed duplicated region for block: B:58:0x0102 A:{SYNTHETIC, Splitter:B:58:0x0102} */
    /* JADX WARNING: Removed duplicated region for block: B:63:0x011a  */
    /* JADX WARNING: Removed duplicated region for block: B:45:0x00c9 A:{SYNTHETIC, Splitter:B:45:0x00c9} */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x00e1  */
    /* JADX WARNING: Removed duplicated region for block: B:58:0x0102 A:{SYNTHETIC, Splitter:B:58:0x0102} */
    /* JADX WARNING: Removed duplicated region for block: B:63:0x011a  */
    /* JADX WARNING: Removed duplicated region for block: B:45:0x00c9 A:{SYNTHETIC, Splitter:B:45:0x00c9} */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x00e1  */
    public final void run() {
        /*
        r13 = this;
        r0 = "Error closing HTTP compressed POST connection output stream. appId";
        r1 = r13.f;
        r1.f();
        r1 = 0;
        r2 = 0;
        r3 = r13.f;	 Catch:{ IOException -> 0x00fb, all -> 0x00c2 }
        r4 = r13.a;	 Catch:{ IOException -> 0x00fb, all -> 0x00c2 }
        r3 = r3.s(r4);	 Catch:{ IOException -> 0x00fb, all -> 0x00c2 }
        r4 = r13.e;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        if (r4 == 0) goto L_0x0039;
    L_0x0015:
        r4 = r4.entrySet();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r4 = r4.iterator();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
    L_0x001d:
        r5 = r4.hasNext();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        if (r5 == 0) goto L_0x0039;
    L_0x0023:
        r5 = r4.next();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = (java.util.Map.Entry) r5;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r6 = r5.getKey();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r6 = (java.lang.String) r6;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r5.getValue();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = (java.lang.String) r5;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r3.addRequestProperty(r6, r5);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        goto L_0x001d;
    L_0x0039:
        r4 = r13.b;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        if (r4 == 0) goto L_0x0084;
    L_0x003d:
        r4 = r13.f;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r4 = r4.m();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r13.b;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r4 = r4.T(r5);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r13.f;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r5.d();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r5.n;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r6 = "Uploading data. size";
        r7 = r4.length;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r7 = java.lang.Integer.valueOf(r7);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5.b(r6, r7);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = 1;
        r3.setDoOutput(r5);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = "Content-Encoding";
        r6 = "gzip";
        r3.addRequestProperty(r5, r6);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r4.length;	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r3.setFixedLengthStreamingMode(r5);	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r3.connect();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5 = r3.getOutputStream();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r5.write(r4);	 Catch:{ IOException -> 0x007e, all -> 0x0078 }
        r5.close();	 Catch:{ IOException -> 0x007e, all -> 0x0078 }
        goto L_0x0084;
    L_0x0078:
        r4 = move-exception;
        r10 = r1;
        r2 = r4;
        r1 = r5;
        goto L_0x00c6;
    L_0x007e:
        r4 = move-exception;
        r10 = r1;
        r8 = r4;
        r1 = r5;
        goto L_0x00ff;
    L_0x0084:
        r8 = r3.getResponseCode();	 Catch:{ IOException -> 0x00bf, all -> 0x00bc }
        r11 = r3.getHeaderFields();	 Catch:{ IOException -> 0x00b7, all -> 0x00b2 }
        r10 = c.e.a.b.f.b.x3.t(r3);	 Catch:{ IOException -> 0x00ae, all -> 0x00a9 }
        r3.disconnect();
        r0 = r13.f;
        r0 = r0.a();
        r1 = new c.e.a.b.f.b.y3;
        r6 = r13.d;
        r7 = r13.c;
        r9 = 0;
        r12 = 0;
        r5 = r1;
        r5.m1521init(r6, r7, r8, r9, r10, r11, r12);
        r0.v(r1);
        return;
    L_0x00a9:
        r4 = move-exception;
        r2 = r4;
        r7 = r8;
        r10 = r11;
        goto L_0x00c7;
    L_0x00ae:
        r4 = move-exception;
        r7 = r8;
        r10 = r11;
        goto L_0x00ba;
    L_0x00b2:
        r4 = move-exception;
        r10 = r1;
        r2 = r4;
        r7 = r8;
        goto L_0x00c7;
    L_0x00b7:
        r4 = move-exception;
        r10 = r1;
        r7 = r8;
    L_0x00ba:
        r8 = r4;
        goto L_0x0100;
    L_0x00bc:
        r4 = move-exception;
        r10 = r1;
        goto L_0x00c5;
    L_0x00bf:
        r4 = move-exception;
        r10 = r1;
        goto L_0x00fe;
    L_0x00c2:
        r4 = move-exception;
        r3 = r1;
        r10 = r3;
    L_0x00c5:
        r2 = r4;
    L_0x00c6:
        r7 = 0;
    L_0x00c7:
        if (r1 == 0) goto L_0x00df;
    L_0x00c9:
        r1.close();	 Catch:{ IOException -> 0x00cd }
        goto L_0x00df;
    L_0x00cd:
        r1 = move-exception;
        r4 = r13.f;
        r4 = r4.d();
        r4 = r4.f;
        r5 = r13.d;
        r5 = c.e.a.b.f.b.q3.s(r5);
        r4.c(r0, r5, r1);
    L_0x00df:
        if (r3 == 0) goto L_0x00e4;
    L_0x00e1:
        r3.disconnect();
    L_0x00e4:
        r0 = r13.f;
        r0 = r0.a();
        r1 = new c.e.a.b.f.b.y3;
        r5 = r13.d;
        r6 = r13.c;
        r8 = 0;
        r9 = 0;
        r11 = 0;
        r4 = r1;
        r4.m1521init(r5, r6, r7, r8, r9, r10, r11);
        r0.v(r1);
        throw r2;
    L_0x00fb:
        r4 = move-exception;
        r3 = r1;
        r10 = r3;
    L_0x00fe:
        r8 = r4;
    L_0x00ff:
        r7 = 0;
    L_0x0100:
        if (r1 == 0) goto L_0x0118;
    L_0x0102:
        r1.close();	 Catch:{ IOException -> 0x0106 }
        goto L_0x0118;
    L_0x0106:
        r1 = move-exception;
        r2 = r13.f;
        r2 = r2.d();
        r2 = r2.f;
        r4 = r13.d;
        r4 = c.e.a.b.f.b.q3.s(r4);
        r2.c(r0, r4, r1);
    L_0x0118:
        if (r3 == 0) goto L_0x011d;
    L_0x011a:
        r3.disconnect();
    L_0x011d:
        r0 = r13.f;
        r0 = r0.a();
        r1 = new c.e.a.b.f.b.y3;
        r5 = r13.d;
        r6 = r13.c;
        r9 = 0;
        r11 = 0;
        r4 = r1;
        r4.m1521init(r5, r6, r7, r8, r9, r10, r11);
        r0.v(r1);
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.c4.run():void");
    }
}
